]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
messageList: Drop methods to customize the body of a message
authorJulian Sparber <julian@sparber.net>
Tue, 20 Feb 2024 16:33:35 +0000 (17:33 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 3 Mar 2024 01:33:16 +0000 (01:33 +0000)
Since only the telepathy client needed a special actor as expanded body
we can now drop the methods for it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3173>

js/ui/messageList.js

index 8338e77660b3947536f285c4b501ff5674fe1758..b5ee41cd7f2e824e63ca5117e995ad7e51fcca32 100644 (file)
@@ -507,6 +507,8 @@ export const Message = GObject.registerClass({
         this.bodyLabel = new URLHighlighter('', false, this._useBodyMarkup);
         this.bodyLabel.add_style_class_name('message-body');
         this._bodyStack.add_child(this.bodyLabel);
+        this._expandedLabel = new URLHighlighter('', true, this._useBodyMarkup);
+        this._bodyStack.add_child(this._expandedLabel);
         this.setBody(body);
 
         this.connect('destroy', this._onDestroy.bind(this));
@@ -543,8 +545,7 @@ export const Message = GObject.registerClass({
         this._bodyText = text;
         this.bodyLabel.setMarkup(text ? text.replace(/\n/g, ' ') : '',
             this._useBodyMarkup);
-        if (this._expandedLabel)
-            this._expandedLabel.setMarkup(text, this._useBodyMarkup);
+        this._expandedLabel.setMarkup(text, this._useBodyMarkup);
     }
 
     setUseBodyMarkup(enable) {
@@ -579,34 +580,11 @@ export const Message = GObject.registerClass({
         return button;
     }
 
-    setExpandedBody(actor) {
-        if (actor == null) {
-            if (this._bodyStack.get_n_children() > 1)
-                this._bodyStack.get_child_at_index(1).destroy();
-            return;
-        }
-
-        if (this._bodyStack.get_n_children() > 1)
-            throw new Error('Message already has an expanded body actor');
-
-        this._bodyStack.insert_child_at_index(actor, 1);
-    }
-
-    setExpandedLines(nLines) {
-        this._bodyStack.layout_manager.expandLines = nLines;
-    }
-
     expand(animate) {
         this.expanded = true;
 
         this._actionBin.visible = this._actionBin.get_n_children() > 0;
 
-        if (this._bodyStack.get_n_children() < 2) {
-            this._expandedLabel = new URLHighlighter(this._bodyText,
-                true, this._useBodyMarkup);
-            this.setExpandedBody(this._expandedLabel);
-        }
-
         const duration = animate ? MessageTray.ANIMATION_TIME : 0;
         this._bodyStack.ease_property('@layout.expansion', 1, {
             progress_mode: Clutter.AnimationMode.EASE_OUT_QUAD,